package bit_exercises.Day37;

/**
 * @author zerorain
 * @date 2022/06/28 16:35
 **/
//第一题， 数据库连接池
import java.util.*;
public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            int max = 0;
            Set<String> s = new HashSet<>();
            while(n != 0){
                String id,record;
                id = sc.next();
                record = sc.next();
                if(record.equals("connect")){
                    s.add(id);
                }else{
                    s.remove(id);
                }
                max = Math.max(max,s.size());
                n--;
            }
            System.out.println(max);

        }
    }
}
//第二题 mkdir